home *** CD-ROM | disk | FTP | other *** search
- # Jedi Knight Missions Cog Script
- #
- # ITEM_TUSKEN_CLOTHES.COG
- #
- # INVENTORY SCRIPT - Tusken Clothes
- #
- # [TT]
- #
- # (C) 1997 LucasArts Entertainment Co. All Rights Reserved
-
-
- symbols
-
- thing player local
- thing playermodel local
- model tusken=kyA15.3do local
- model oldModel local
-
- int iAlignmentPriority=-1 local
- int destroyclothes=0 local
-
- message activated
- message user0
- message killed
-
- sound clothesActivate=activate01.wav
- sound clothesDeactivate=deactivate03.wav
- sound voiceline=MJ62102.wav
-
- end
-
- # ========================================================================================
-
- code
-
- activated:
- player = GetSourceRef();
- playermodel = jkGetLocalPlayer();
-
- if(GetInv(player, 52))
- {
- if (iAlignmentPriority != -1)
- {
- aiRemoveAlignmentPriority(iAlignmentPriority);
-
- iAlignmentPriority = -1;
- }
-
- if(IsInvActivated(player, 52) == 0)
- {
- // Print("Tusken Clothes ON");
- jkPrintUNIString(player, 271);
- SetInvActivated(player, 52, 1);
- PlaySoundThing(clothesActivate, player, 1.0, -1, -1, 0x80);
-
- // Switch models, keeping track of the old one.
- oldModel = SetThingModel(playermodel, tusken);
-
- // If persuasion was on, set the geo mode back to where it should be.
- if(IsInvActivated(player, 26))
- SetThingCurGeoMode(player, 0);
-
- iAlignmentPriority = aiAddAlignmentPriority(0.0, 1);
- }
- else
- {
- // Print("Tusken Clothes OFF");
- jkPrintUNIString(player, 272);
- SetInvActivated(player, 52, 0);
-
- // Switch back to the old model.
- if(!IsInvActivated(player, 23))
- SetThingModel(playermodel, oldModel);
- PlaySoundThing(clothesDeactivate, player, 1.0, -1, -1, 0x80);
-
- // If persuasion was on, set the geo mode back to where it should be.
- if(IsInvActivated(player, 26))
- SetThingCurGeoMode(player, 0);
- }
- }
-
- Return;
-
- user0:
- if(IsInvActivated(player, 52) == 1)
- {
- if (iAlignmentPriority != -1)
- {
- aiRemoveAlignmentPriority(iAlignmentPriority);
-
- iAlignmentPriority = -1;
- }
-
- PlaySoundLocal(voiceline, 1.0, 0.0, 0);
- // Print("Tusken Clothes OFF");
- jkPrintUNIString(player, 272);
- SetInvActivated(player, 52, 0);
-
- // Switch back to the old model.
- if(!IsInvActivated(player, 23))
- SetThingModel(playermodel, oldModel);
- PlaySoundThing(clothesDeactivate, player, 1.0, -1, -1, 0x80);
-
- // If persuasion was on, set the geo mode back to where it should be.
- if(IsInvActivated(player, 26))
- SetThingCurGeoMode(player, 0);
- }
- SetInvAvailable(player, 52, 0);
- return;
-
- # ========================================================================================
-
- killed:
- return;
-
- end
-